package cn.gson.fengboot.model.pojos;

import javax.persistence.*;
import java.sql.Timestamp;
import java.util.Objects;

@Entity
public class Lchucha {
    private int ccId; //出差ID
    private String ccZhuti; //出差主题
    private String ccMdd; //出差目的地
    private Timestamp ccKstime; //出差开始时间
    private Timestamp ccJstime; //出差结束时间
    private String ccZt; //审批状态
    private String ccJtgj; //出差交通工具
    private String ccBeizhu; //出差备注
    private String ccDdykehu; //客户名称
    private int ccZtcx; //客户名称
    private QempFrom empId;//员工

    //一个员工可能有多次出差，多对一
    @ManyToOne
    @JoinColumn(name = "emp_id")
    public QempFrom getEmpId() {
        return empId;
    }

    public void setEmpId(QempFrom empId) {
        this.empId = empId;
    }


    @Id
    @Column(name = "cc_id")
    public int getCcId() {
        return ccId;
    }

    public void setCcId(int ccId) {
        this.ccId = ccId;
    }



    @Basic
    @Column(name = "cc_zhuti")
    public String getCcZhuti() {
        return ccZhuti;
    }

    public void setCcZhuti(String ccZhuti) {
        this.ccZhuti = ccZhuti;
    }


    @Basic
    @Column(name = "cc_mdd")
    public String getCcMdd() {
        return ccMdd;
    }

    public void setCcMdd(String ccMdd) {
        this.ccMdd = ccMdd;
    }

    @Basic
    @Column(name = "cc_kstime")
    public Timestamp getCcKstime() {
        return ccKstime;
    }

    public void setCcKstime(Timestamp ccKstime) {
        this.ccKstime = ccKstime;
    }

    @Basic
    @Column(name = "cc_jstime")
    public Timestamp getCcJstime() {
        return ccJstime;
    }

    public void setCcJstime(Timestamp ccJstime) {
        this.ccJstime = ccJstime;
    }

    @Basic
    @Column(name = "cc_zt")
    public String getCcZt() {
        return ccZt;
    }

    public void setCcZt(String ccZt) {
        this.ccZt = ccZt;
    }


    @Basic
    @Column(name = "cc_jtgj")
    public String getCcJtgj() {
        return ccJtgj;
    }

    public void setCcJtgj(String ccJtgj) {
        this.ccJtgj = ccJtgj;
    }

    @Basic
    @Column(name = "cc_beizhu")
    public String getCcBeizhu() {
        return ccBeizhu;
    }

    public void setCcBeizhu(String ccBeizhu) {
        this.ccBeizhu = ccBeizhu;
    }


    @Basic
    @Column(name = "cc_dykehu")
    public String getCcDdykehu() {
        return ccDdykehu;
    }

    public void setCcDdykehu(String ccDdykehu) {
        this.ccDdykehu = ccDdykehu;
    }

    @Basic
    @Column(name = "cc_ztcx")
    public int getCcZtcx() {
        return ccZtcx;
    }

    public void setCcZtcx(int ccZtcx) {
        this.ccZtcx = ccZtcx;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Lchucha lchucha = (Lchucha) o;
        return ccId == lchucha.ccId &&
                Objects.equals(ccZhuti, lchucha.ccZhuti) &&
                Objects.equals(ccMdd, lchucha.ccMdd) &&
                Objects.equals(ccKstime, lchucha.ccKstime) &&
                Objects.equals(ccJstime, lchucha.ccJstime) &&
                Objects.equals(ccZt, lchucha.ccZt) &&
                Objects.equals(ccJtgj, lchucha.ccJtgj) &&
                Objects.equals(ccBeizhu, lchucha.ccBeizhu)&&
                Objects.equals(ccDdykehu, lchucha.ccDdykehu)&&
                Objects.equals(ccZtcx, lchucha.ccZtcx)&&
                 Objects.equals(empId, lchucha.empId);
    }

    @Override
    public int hashCode() {
        return Objects.hash(ccId, ccZhuti,ccMdd, ccKstime, ccJstime, ccZt,ccJtgj, ccBeizhu,ccDdykehu,ccZtcx,empId);
    }
}
